package rent.hj.launcher;

import android.content.Context;
import android.content.SharedPreferences;

/**
 * Created by admin on 2017/12/19.
 */

public class Time {

    public Time(Context context) {
        this.context = context;
        sharedPreferences = context.getSharedPreferences("default", Context.MODE_PRIVATE);
        editor = sharedPreferences.edit();
    }

    public long getStartTime(){
        return sharedPreferences.getLong("start_time",-1);
    }

    public long getEndTime(){
        return sharedPreferences.getLong("end_time",-1);
    }

    public void setStartTime(long time){
        editor.putLong("start_time",time).commit();
    }

    public void setEndTime(long time){
        editor.putLong("end_time",time).commit();
    }
    private Context context;
    private SharedPreferences sharedPreferences;
    private SharedPreferences.Editor editor;
}
